// 各个页面公用的js
// 计算有表格页面div容器（id="tableContent"）
export const tableBoxHeight = () => {
  var Height = window.innerHeight;
  // console.log(Height);
  var tools = document.getElementById("tools");
  var tableContent = document.getElementById("tableContent");
  // console.log(tools.offsetHeight);
  tableContent.style.height = Height - tools.offsetHeight - 1 + "px";
  // console.log(tableContent.style.height);
};
export const tableBoxHeightApproval = () => {
  var Height = window.innerHeight;
  // console.log(Height);
  var tools = document.getElementById("tools");
  var tableContent = document.getElementsByClassName("tableContent");

  for (var i = 0; i < tableContent.length; i++) {
    //设置每个元素的背景颜色
    tableContent[i].style.height = Height - tools.offsetHeight - 1 + "px";
  }
};

// 原本是获取树容器高度的，现在的树插件不需要了
export const treeBoxHeight = () => {
  var Height = window.innerHeight;
  var leftTab = document.getElementById("leftTab");
  leftTab.style.height = Height + "px";
  console.log(leftTab.style.height);
  //返回的高度为deptTree组件绑定treeHeight属性的高度，在主体页面引用此方法，并在mounted()里执行赋值给所引用组件所绑定treeHeight属性；32是组件中tab选项卡的高度，43是组件中搜索占用的高度
  var treeHeight = leftTab.offsetHeight - 32 - 43 + "px";
  console.log(treeHeight);
  return treeHeight;
};


